<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
	<h3>Search Results</h3>
	<table border="0" style="width:100%" cellpadding="2">
		<tr>
			<th>Sr.No.</th>	
			<th>Patient Id</th>
			<th>Patient Name</th>
			<th>Age</th>
			<th>Address</th>
		</tr>
		<c:forEach var="dto" items="${searchResult}" varStatus="status">
			<tr class="alt">
				<td width="50">${status.index + 1}</td>
				<td width="100">${dto.patient.patientId}</td>
				<td width="200">
				<spring:url value="/patient/profile?patientId=${dto.patient.patientId}" var="allTestsUrl"></spring:url>
				<a href="${allTestsUrl}">${dto.patient.firstName} ${dto.patient.middleName}
					${dto.patient.lastName}</a></td>
				<td width="40">${dto.patient.gender }</td>	
				<td width="40">${dto.patientAge }</td>
				<td>${dto.address.building} ${dto.address.street}</td>
				<td width="105">
				<spring:url value="/patho/add?patientId=${dto.patient.patientId}" var="addPathoTestUrl"></spring:url>
				<a href="${addPathoTestUrl}"><strong>Pathology Tests</strong></a></td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>